package com.aiwiown.face.request;

import com.aiwiown.face.ApiMethod;
import com.aiwiown.face.ApiObject;
import com.aiwiown.face.ApiRequest;
import com.aiwiown.face.internal.util.RequestParamUtils;
import com.aiwiown.face.response.OCRBankCardBetaResponse;

import java.util.Map;

/**
 *描述
 * 检测和识别各类银行卡，并返回银行卡卡片边框坐标、银行卡号码、所属银行及支持的金融组织服务。支持任意角度的识别。
 * https://api-cn.faceplusplus.com/cardpp/beta/ocrbankcard
 *
 * @author admin
 */
public class OCRBankCardBetaRequest implements ApiRequest<OCRBankCardBetaResponse> {

    private static final long serialVersionUID = 8048354776369897592L;

    private String apiVersion = "beta";
    private static String apiUrl = "/ocrbankcard";

    private String bizContent;
    private ApiObject bizModel = null;

    @Override
    public ApiMethod getApiMethod() {
        return ApiMethod.POST;
    }

    @Override
    public String getApiUrl() {
        return "/" + this.apiVersion + apiUrl;
    }

    @Override
    public Map<String, String> getTextParams() throws IllegalAccessException {
        return RequestParamUtils.getTextParams(this.bizModel);
    }

    @Override
    public Map<String, byte[]> getByteArrayParams() throws IllegalAccessException {
        return RequestParamUtils.getByteArrayParams(this.bizModel);
    }

    @Override
    public Class<OCRBankCardBetaResponse> getResponseClass() {
        return OCRBankCardBetaResponse.class;
    }

    @Override
    public String getApiVersion() {
        return this.apiVersion;
    }

    @Override
    public String getBizContent() {
        return this.bizContent;
    }

    public void setBizModel(ApiObject bizModel) {
        this.bizModel = bizModel;
    }

    @Override
    public String signVersion() {
        return null;
    }

    @Override
    public String getSignInfo(String apiKey, String secretKey) throws Exception {
        return null;
    }
}
